<template>
  <div class="main-container">
    <div class="l_title">填写申请信息</div>
    <div class="i_title flex">
      <p>通过项目方资质认证即可申请上币</p>
    </div>
    <div class="info_form">
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="联系方式">
          <el-input v-model="form.tel" placeholder="请填写手机号码" maxlength="15"></el-input>
        </el-form-item>
        <el-form-item label="币种名称">
          <el-input v-model="form.name"  maxlength="30"></el-input>
        </el-form-item>
        <el-form-item label="币种信息">
          <el-input type="textarea" v-model="form.desc" placeholder="如：白皮书、官网等信息"
            maxlength="500"  show-word-limit
            :autosize="{ minRows: 5, maxRows: 8}"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">立即申请</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      userData: this.userModel,
      showLoading: true,
      TGurl:'',
      activeIndex: '/FrTrade/c2cTrade',
      userShopType:'',
      indexList:'1',
      form: {
          tel:'',
          name:'',
          desc:'',
        }
    };
  },
  methods: {
    onSubmit() {
      if (!this.Util.isPhone(this.form.tel)) {
          this.errMsg("label123");
          return
      }
      if (this.form.name==''||this.form.desc=='') {
          this.$message.error('币种名称不能为空');
          return
      }
      let postData={
        tel:this.form.tel,
        coin:this.form.name,
        info:this.form.desc,
      }
      this.request(this.api.add_apply,postData).then(res => {
        if (res.code == "0") {
          this.form.tel='';
          this.form.name='';
          this.form.desc='';
        }else{
          this.errMsg(res.msg);
          return
      }
      })
    }
  }
};
</script>
<style lang="scss" scoped>
.main-container {
  width: $content-width;
  margin: 0 auto;
  .l_title {
    font-size: 20px;
    height: 60px;
    line-height: 60px;
    margin: 20px 0;
    border-radius: 3px;
    padding: 0 30px;
    background: #f1f1f1;
  }
  .paragraph {
    display: block;
    padding: 30px 0 10px;
    font-size: 14px;
    background: #f1f1f1;
    line-height: 1.5;
  }
  .i_title{
    background: #f1f1f1;height: 55px;margin-bottom:20px;
    p{line-height: 55px;margin-left: 15px;}
    .i_login{color: #357ce1;cursor: pointer;}
  }
  .info_form{margin-bottom: 200px;width: 600px;}
  .item_box{
    .text_one{
      h3{font-weight: 600;line-height: 30px;}
      p{line-height: 20px;color: #9194a4;}
    }
  }
}
</style>